<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>正则表达式</title>
</head>
<body>
    <input type="text" placeholder="请输入用户名">
    <br>
    <input type="password" placeholder="请输入密码">
    <br>
    <input type="email" placeholder="请输入邮箱">
</body>
<script>
                // good 23 up 103
    var str = "good Good study,day Day up!!! 23 56 103";
    // 字面量创建正则表达式
    // var pattern = /day/gi;

    // 使用new 关键字创建 正则表达式对象
   /*  var pattern = new RegExp('good',"gi");
    // match
    var a = str.match(pattern);
    console.log(a); */

    /* var newStr = str.match(/(good|23|up|103)/g);
    console.log(newStr.join());
    var newsss = str.replace(/(good|23|up|103)/g,"你好");
    // var newsss = str.replace("good 23 up 103","你好");
    console.log(newsss); */

    var regexp = new RegExp(/day/,'gi');
    // console.log(regexp.ignoreCase);
    for(var i = 0;i<str.length;i++){
        regexp.test(str);
        console.log(regexp.lastIndex);
    }
</script>
</html>